<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组对象相互转换</title>
</head>
<body>
    <script>
        //定义对象
        let obj = {
            name:"cq",
            age:18,
            height:1.90
        }
        //转换为数组
        obj =Object.entries(obj);
        console.log(obj);
        for(arr of obj)
        {
            for(el of arr)
            {
                console.log(el);
            }
        }
        //转换回对象类型
        obj = Object.fromEntries(obj);
        console.log(obj.name,obj.age,obj.height);

    </script>
</body>
</html>